import Foundation

let firstRyzenPatch = kPatch(arch: "x86_64", base: "_i386_switch_lbrs", comment: "algrey - Disable _i386_switch_lbrs", count: 0, enabled: true, find: Data(), identifier: "kernel", limit: 0, mask: Data(), maxKernel: "20.99.99", minKernel: "20.1.0", replace: Data([0xc3]), replaceMask: Data(), skip: 0)

let secondRyzenPatch = kPatch(arch: "x86_64", base: "_i386_lbr_init", comment: "algrey - Disable _i386_lbr_init", count: 0, enabled: true, find: Data(), identifier: "kernel", limit: 0, mask: Data(), maxKernel: "20.99.99", minKernel: "20.1.0", replace: Data([0xc3]), replaceMask: Data(), skip: 0)

let thirdRyzenPatch = kPatch(arch: "x86_64", base: "", comment: "algrey - _i386_init_slave - Remove wrmsr 0x1c8", count: 0, enabled: true, find: Data([0xB8, 0x01, 0x00, 0x00, 0x00, 0xB9, 0xC8, 0x01, 0x00,  0x00, 0x31, 0xD2, 0x0F, 0x30]), identifier: "kernel", limit: 0, mask: Data(), maxKernel: "20.99.99", minKernel: "20.1.0", replace: Data([0x66, 0x0F, 0x1F, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x1F, 0x44, 0x00, 0x00]), replaceMask: Data(), skip: 0)

let forthRyzenPatch = kPatch(arch: "x86_64", base: "_i386_lbr_native_state_to_mach_thread_state", comment: "algrey - Disable _i386_lbr_native_state_to_mach_thread_state", count: 0, enabled: true, find: Data(), identifier: "kernel", limit: 0, mask: Data(), maxKernel: "20.99.99", minKernel: "20.1.0", replace: Data([0xc3]), replaceMask: Data(), skip: 0)

let fifthRyzenPatch = kPatch(arch: "x86_64", base: "", comment: "algrey - commpage_populate -remove rdmsr", count: 1, enabled: true, find: Data([0xB9, 0xA0, 0x01, 0x00, 0x00, 0x0F, 0x32]), identifier: "kernel", limit: 0, mask: Data(), maxKernel: "20.99.99", minKernel: "17.0.0", replace: Data([0x0F, 0x1F, 0x80, 0x00, 0x00, 0x00, 0x00]), replaceMask: Data(), skip: 0)

let sixthRyzenPatch = kPatch(arch: "x86_64", base: "_cpu_topology_sort", comment: "algrey - cpu_topology_sort -disable _x86_validate_topology", count: 1, enabled: true, find: Data([0xE8, 0x00, 0x00, 0xFF, 0xFF]), identifier: "kernel", limit: 0, mask: Data([0xFF, 0x00, 0x00, 0xFF, 0xFF]), maxKernel: "20.99.99", minKernel: "17.0.0", replace: Data([0x0F, 0x1F, 0x44, 0x00, 0x00]), replaceMask: Data(), skip: 0)

let seventhRyzenPatch = kPatch(arch: "x86_64", base: "", comment: "algrey - cpuid_set_cache_info - cpuid 0x8000001D instead 0 - 10.15/10.16", count: 1, enabled: true, find: Data([0x31, 0xC0, 0x31, 0xDB, 0x31, 0xC9, 0x31, 0xD2, 0x0F, 0xA2, 0x41, 0x89, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74]), identifier: "kernel", limit: 0, mask: Data([0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF]), maxKernel: "20.99.99", minKernel: "19.0.0", replace: Data([0xB8, 0x1D, 0x00, 0x00, 0x80, 0x31, 0xDB, 0x31, 0xC9, 0x31, 0xD2, 0x0F, 0xA2, 0x41, 0x89, 0xC6, 0x0F, 0x1F, 0x40, 0x00, 0xEB]), replaceMask: Data(), skip: 0)

let eigthRyzenPatch = kPatch(arch: "x86_64", base: "", comment: "algrey - cpuid_set_cache_info - cpuid 0x8000001D instead 0 - 10.13/10.14", count: 1, enabled: true, find: Data([0x31, 0xC0, 0x31, 0xDB, 0x31, 0xC9, 0x31, 0xD2, 0x0F, 0xA2, 0x41, 0x89, 0xC6, 0x41, 0x89, 0xD1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]), identifier: "kernel", limit: 0, mask: Data([0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF]), maxKernel: "18.99.99", minKernel: "17.0.0", replace: Data([0xB8, 0x1D, 0x00, 0x00, 0x80, 0x31, 0xDB, 0x31, 0xC9, 0x31, 0xD2, 0x0F, 0xA2, 0x41, 0x89, 0xC6, 0x41, 0x89, 0xD1, 0xEB, 0x1C, 0x66, 0x90]), replaceMask: Data(), skip: 0)

let ninthRyzenPatch = kPatch(arch: "x86_64", base: "", comment: "algrey - cpuid_set_cache_info - cpuid 0x8000001D instead 4", count: 1, enabled: true, find: Data([0xB8, 0x04, 0x00, 0x00, 0x00, 0x44, 0x89, 0xF1, 0x44, 0x89]), identifier: "kernel", limit: 0, mask: Data(), maxKernel: "20.99.99", minKernel: "17.0.0", replace: Data([0xB8, 0x1D, 0x00, 0x00, 0x80, 0x44, 0x89, 0xF1, 0x44, 0x89]), replaceMask: Data(), skip: 0)

let tenthRyzenPatch = kPatch(arch: "x86_64", base: "", comment: "algrey - cpuid_set_cache_info - don't set cpuid_cores_per_package", count: 1, enabled: true, find: Data([0xC1, 0xE0, 0x1A, 0xFF, 0xC0]), identifier: "kernel", limit: 0, mask: Data([0xFF, 0xF0, 0xFF, 0xFF, 0xF0]), maxKernel: "20.99.99", minKernel: "17.0.0", replace: Data([0x0F, 0x1F, 0x00, 0xEB, 0x06]), replaceMask: Data(), skip: 0)

let eleventhRyzenPatch = kPatch(arch: "x86_64", base: "", comment: "NoOne - skip cpuid_cores_per_package test - 10.15/10.16", count: 0, enabled: true, find: Data([0x83, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8B, 0x00, 0xBC]), identifier: "kernel", limit: 0, mask: Data([0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0xFF]), maxKernel: "20.99.99", minKernel: "19.0.0", replace: Data([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]), replaceMask: Data([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]), skip: 0)

let twelfthRyzenPatch = kPatch(arch: "x86_64", base: "", comment: "algrey - skip cpuid_cores_per_package test - 10.13/10.14", count: 0, enabled: true, find: Data([0x83,0x3D,0x00,0x00,0x00,0x00,0x00,0x74, 0x00,0x8B,0x5D,0xBC]), identifier: "kernel", limit: 0, mask: Data([0xFF,0xFF,0x00,0x00, 0x00,0xFF,0xFF,0xFF, 0x00,0xFF,0xFF,0xFF]), maxKernel: "18.99.99", minKernel: "17.0.0", replace: Data([0x00,0x00,0x00,0x00, 0x00,0x00,0x01,0x00, 0x00,0x00,0x00,0x00 ]), replaceMask: Data([0x00,0x00,0x00,0x00, 0x00,0x00,0x0F,0x00, 0x00,0x00,0x00,0x00 ]), skip: 0)

let thirteenthRyzenPatch = kPatch(arch: "x86_64", base: "", comment: "algrey - cpuid_set_generic_info - remove wrmsr", count: 1, enabled: true, find: Data([0xB9,0x8B,0x00,0x00, 0x00,0x31,0xC0,0x31, 0xD2,0x0F,0x30]), identifier: "kernel", limit: 0, mask: Data(), maxKernel: "20.99.99", minKernel: "17.0.0", replace: Data([0x66,0x0F,0x1F,0x84, 0x00,0x00,0x00,0x00, 0x00,0x66,0x90]), replaceMask: Data(), skip: 0)

let fourteenthRyzenPatch = kPatch(arch: "x86_64", base: "", comment: "algrey - cpuid_set_generic_info - set microcode=186", count: 1, enabled: true, find: Data([0xB9,0x8B,0x00,0x00, 0x00,0x0F,0x32]), identifier: "kernel", limit: 0, mask: Data(), maxKernel: "20.99.99", minKernel: "17.0.0", replace: Data([0xBA,0xBA,0x00,0x00, 0x00,0x66,0x90]), replaceMask: Data(), skip: 0)

let fiftheenthRyzenPatch = kPatch(arch: "x86_64", base: "", comment: "algrey - cpuid_set_generic_info - set flag=1", count: 1, enabled: true, find: Data([0xB9,0x17,0x00,0x00, 0x00,0x0F,0x32,0xC1, 0xEA,0x12,0x80,0xE2, 0x07]), identifier: "kernel", limit: 0, mask: Data(), maxKernel: "20.99.99", minKernel: "17.0.0", replace: Data([0xB2,0x01,0x66,0x0F, 0x1F,0x84,0x00,0x00, 0x00,0x00,0x00,0x66, 0x90]), replaceMask: Data(), skip: 0)

let sixthteenthRyzenPatch = kPatch(arch: "x86_64", base: "", comment: "algrey - cpuid_set_generic_info - disable check to allow leaf7", count: 1, enabled: true, find: Data([0x00,0x3A,0x0F,0x82 ]), identifier: "kernel", limit: 0, mask: Data(), maxKernel: "20.99.99", minKernel: "17.0.0", replace: Data([0x00,0x00,0x0F,0x82 ]), replaceMask: Data(), skip: 0)

let seventeethRyzenPatch = kPatch(arch: "x86_64", base: "", comment: "algrey - cpuid_set_info - GenuineIntel to AuthenticAMD", count: 1, enabled: true, find: Data([0x47,0x65,0x6E,0x75, 0x69,0x6E,0x65,0x49, 0x6E,0x74,0x65,0x6C, 0x00]), identifier: "kernel", limit: 0, mask: Data(), maxKernel: "20.99.99", minKernel: "17.0.0", replace: Data([0x41,0x75,0x74,0x68, 0x65,0x6E,0x74,0x69, 0x63,0x41,0x4D,0x44, 0x00]), replaceMask: Data(), skip: 0)

let eigthteethRyzenPatch = kPatch(arch: "x86_64", base: "", comment: "algrey - cpuid_set_cpufamily - force CPUFAMILY_INTEL_PENRYN", count: 1, enabled: true, find: Data([0x31,0xDB,0x80,0x3D, 0x00,0x00,0x00,0x00, 0x06,0x75,0x00]), identifier: "kernel", limit: 0, mask: Data([0xFF,0xFF,0xFF,0xFF, 0x00,0x00,0x00,0xFF, 0xFF,0xFF,0x00]), maxKernel: "20.99.99", minKernel: "17.0.0", replace: Data([0xBB,0xBC,0x4F,0xEA, 0x78,0xE9,0x5D,0x00, 0x00,0x00,0x90]), replaceMask: Data(), skip: 0)

let ninthteenthRyzenPatch = kPatch(arch: "x86_64", base: "_cpuid_set_info", comment: "algrey - cpuid_set_info - jmp to calculations and set cpuid_cores_per_package - 10.15/10.16", count: 1, enabled: true, find: Data([0x75,0x71,0xE8,0x00, 0x00,0x00,0x00,0x48, 0x8B,0x05,0x00,0x00, 0x00,0x00,0x48,0x89, 0x05,0x00,0x00,0x00, 0x00]), identifier: "kernel", limit: 0, mask: Data([0xFF,0xFF,0xFF,0x00, 0x00,0x00,0x00,0xFF, 0xFF,0xFF,0x00,0x00, 0x00,0x00,0xFF,0xFF, 0xFF,0x00,0x00,0x00, 0x00]), maxKernel: "20.99.99", minKernel: "19.0.0", replace: Data([0x74,0x4E,0x00,0x00, 0x00,0x00,0x00,0x90, 0x89,0x0D,0x00,0x00, 0x00,0x00,0xE9,0x7E, 0x00,0x00,0x00,0x66, 0x90]), replaceMask: Data([0xFF,0xFF,0x00,0x00, 0x00,0x00,0x00,0xFF, 0xFF,0xFF,0x00,0x00, 0x00,0x00,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF]), skip: 0)

let twentiethRyzenPatch = kPatch(arch: "x86_64", base: "_cpuid_set_info", comment: "algrey - cpuid_set_info - cores and threads calculations - 10.15/10.16", count: 1, enabled: true, find: Data([0xB9,0x35,0x00,0x00, 0x00,0x0F,0x32,0x48, 0xC1,0xE2,0x20,0x89, 0xC1,0x48,0x09,0xD1, 0xB9,0x01,0x00,0x01, 0x00,0x0F,0x45,0xC8, 0x0F,0xB7,0xC1,0xC1, 0xE9,0x10,0x83,0xE1, 0x0F,0xEB,0x1E,0xB9, 0x35,0x00,0x00,0x00, 0x0F,0x32,0x48,0xC1, 0xE2,0x20,0x89,0xC1, 0x48,0x09,0xD1,0xB9, 0x01,0x00,0x01,0x00, 0x0F,0x45,0xC8,0x0F, 0xB7,0xC1,0xC1,0xE9, 0x10]), identifier: "kernel", limit: 0, mask: Data(), maxKernel: "20.99.99", minKernel: "19.0.0", replace: Data([0xB8,0x08,0x00,0x00, 0x80,0x31,0xDB,0x31, 0xC9,0x31,0xD2,0x0F, 0xA2,0x41,0x89,0xCE, 0x45,0x0F,0xB6,0xF6, 0x41,0xFF,0xC6,0xB8, 0x1E,0x00,0x00,0x80, 0x31,0xDB,0x31,0xC9, 0x31,0xD2,0x0F,0xA2, 0x0F,0xB6,0xF7,0xFF, 0xC6,0x44,0x89,0xF1, 0x31,0xD2,0x89,0xC8, 0xF7,0xF6,0x89,0xC1, 0x44,0x89,0xF0,0xE9, 0x7C,0xFF,0xFF,0xFF, 0x0F,0x1F,0x44,0x00, 0x00]), replaceMask: Data(), skip: 0)

let twentiefirstRyzenPatch = kPatch(arch: "x86_64", base: "", comment: "algrey - cpuid_set_info - ryzen cores and logicals count - part 1 - 10.13", count: 1, enabled: true, find: Data([0xEB,0x16,0xB9,0x35, 0x00,0x00,0x00]), identifier: "kernel", limit: 0, mask: Data(), maxKernel: "17.99.99", minKernel: "17.0.0", replace: Data([0xEB,0x22,0xB9,0x35, 0x00,0x00,0x00]), replaceMask: Data(), skip: 1)

let twentiesecondRyzenPatch = kPatch(arch: "x86_64", base: "", comment: "algrey - cpuid_set_info - ryzen cores and logicals count - part 1 - 10.14", count: 1, enabled: true, find: Data([0xEB,0x38,0xB9,0x35, 0x00,0x00,0x00]), identifier: "kernel", limit: 0, mask: Data(), maxKernel: "18.99.99", minKernel: "18.0.0", replace: Data([0xEB,0x12,0xB9,0x35, 0x00,0x00,0x00]), replaceMask: Data(), skip: 0)

let twentiethirdRyzenPatch = kPatch(arch: "x86_64", base: "_cpuid_set_info", comment: "algrey - cpuid_set_info - ryzen cores and logicals count - part 2 - 10.13/10.14", count: 1, enabled: true, find: Data([0xB9,0x35,0x00,0x00, 0x00,0x0F,0x32,0x48, 0xC1,0xE2,0x20,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 ]), identifier: "kernel", limit: 0, mask: Data([0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 ]), maxKernel: "18.99.99", minKernel: "17.0.0", replace: Data([0x41,0x89,0xCE,0xB8, 0x1E,0x00,0x00,0x80, 0x31,0xDB,0x31,0xC9, 0x31,0xD2,0x0F,0xA2, 0x0F,0xB6,0xF7,0xFF, 0xC6,0x44,0x89,0xF1, 0x31,0xD2,0x89,0xC8, 0xF7,0xF6,0x66,0x90 ]), replaceMask: Data(), skip: 0)

let twentieforthRyzenPatch = kPatch(arch: "x86_64", base: "_cpuid_set_info", comment: "algrey - cpuid_set_info - ryzen cores and logicals count - part 3 - 10.13", count: 1, enabled: true, find: Data([0x89,0x05,0x00,0x00, 0x00,0x00,0x89,0x15, 0x00,0x00,0x00,0x00, 0x85,0xC0,0x75,0x18 ]), identifier: "kernel", limit: 0, mask: Data([0xFF,0xFF,0x00,0x00, 0x00,0xFF,0xFF,0xFF, 0x00,0x00,0x00,0xFF, 0xFF,0xFF,0xFF,0xFF ]), maxKernel: "17.99.99", minKernel: "17.0.0", replace: Data([0x0F,0x1F,0x84,0x00, 0x00,0x00,0x00,0x00, 0x0F,0x1F,0x84,0x00, 0x00,0x00,0x00,0x00 ]), replaceMask: Data(), skip: 0)

let twentiefifthRyzenPatch = kPatch(arch: "x86_64", base: "_cpuid_set_info", comment: "algrey - cpuid_set_info - ryzen cores and logicals count - part 3 - 10.14", count: 1, enabled: true, find: Data([0x85,0xC0,0x74]), identifier: "kernel", limit: 0, mask: Data(), maxKernel: "18.99.99", minKernel: "18.0.0", replace: Data([0x66,0x90,0xEB]), replaceMask: Data(), skip: 1)

let twentiesixthRyzenPatch = kPatch(arch: "x86_64", base: "_cpuid_set_info", comment: "algrey - cpuid_set_info - ryzen cores and logicals count - part 4 - 10.13", count: 1, enabled: true, find: Data([0x8B,0x05,0x00,0x00, 0x00,0x00,0x89,0x00, 0x00,0x00,0x00,0x00, 0x8B,0x05]), identifier: "kernel", limit: 0, mask: Data([0xFF,0xFF,0x00,0x00, 0x00,0xFF,0xFF,0x00, 0x00,0x00,0x00,0xFF, 0xFF,0xFF]), maxKernel: "17.99.99", minKernel: "17.0.0", replace: Data([0x89,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00]), replaceMask: Data([0xFF,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00]), skip: 0)

let twentieseventhRyzenPatch = kPatch(arch: "x86_64", base: "_cpuid_set_info", comment: "algrey - cpuid_set_info - ryzen cores and logicals count - part 4 - 10.14", count: 1, enabled: true, find: Data([0x48,0x8B,0x05,0x00, 0x00,0x00,0x00,0x48, 0x89,0x05,0x00,0x00, 0x00,0x00]), identifier: "kernel", limit: 0, mask: Data([0xFF,0xFF,0xFF,0x00, 0x00,0x00,0xFF,0xFF, 0xFF,0xFF,0x00,0x00, 0x00,0xFF]), maxKernel: "18.99.99", minKernel: "18.0.0", replace: Data([0x90,0x89,0x00,0x00, 0x00,0x00,0x00,0x90, 0x00,0x00,0x00,0x00, 0x00,0x00]), replaceMask: Data([0xFF,0xFF,0x00,0x00, 0x00,0x00,0x00,0xFF, 0x00,0x00,0x00,0x00, 0x00,0x00]), skip: 0)

let twentieeigthRyzenPatch = kPatch(arch: "x86_64", base: "", comment: "algrey - i386_init - remove rdmsr (x3)", count: 0, enabled: true, find: Data([0xB9,0x99,0x01,0x00, 0x00,0x0F,0x32,0x48, 0xC1,0xE2,0x20,0x89, 0xC6,0x48,0x09,0xD6, 0xB9,0x98,0x01,0x00, 0x00,0x0F,0x32,0x48, 0xC1,0xE2,0x20,0x89, 0xC0,0x48,0x09,0xC2, 0xBF,0x58,0x02,0x31, 0x05,0x31,0xC9,0x45, 0x31,0xC0]), identifier: "kernel", limit: 0, mask: Data(), maxKernel: "20.99.99", minKernel: "17.0.0", replace: Data([0x66,0x0F,0x1F,0x84, 0x00,0x00,0x00,0x00, 0x00,0x66,0x0F,0x1F, 0x84,0x00,0x00,0x00, 0x00,0x00,0x66,0x0F, 0x1F,0x84,0x00,0x00, 0x00,0x00,0x00,0x66, 0x0F,0x1F,0x84,0x00, 0x00,0x00,0x00,0x00, 0x66,0x0F,0x1F,0x44, 0x00,0x00]), replaceMask: Data(), skip: 0)

let twentieninthRyzenPatch = kPatch(arch: "x86_64", base: "", comment: "algrey - tsc_init - remove Penryn check to execute default case 10.14", count: 1, enabled: true, find: Data([0x81,0xF9,0xBC,0x4F, 0xEA,0x78,0x0F,0x84, 0xC5,0x01,0x00,0x00 ]), identifier: "kernel", limit: 0, mask: Data(), maxKernel: "18.99.99", minKernel: "18.0.0", replace: Data([0x66,0x66,0x66,0x0F, 0x1F,0x84,0x00,0x00, 0x00,0x00,0x00,0x90 ]), replaceMask: Data(), skip: 0)

let thirtiethRyzenPatch = kPatch(arch: "x86_64", base: "", comment: "algrey - tsc_init - remove Penryn check to execute default case", count: 1, enabled: true, find: Data([0x3D,0xBC,0x4F,0xEA, 0x78,0x0F,0x84,0x00, 0x01,0x00,0x00]), identifier: "kernel", limit: 0, mask: Data([0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0x00, 0xFF,0xFF,0xFF]), maxKernel: "20.99.99", minKernel: "17.0.0", replace: Data([0x66,0x66,0x66,0x0F, 0x1F,0x84,0x00,0x00, 0x00,0x00,0x00]), replaceMask: Data(), skip: 0)

let thirtiefirstRyzenPatch = kPatch(arch: "x86_64", base: "", comment: "algrey - tsc_init - grab DID and VID from MSR", count: 1, enabled: true, find: Data([0xB9,0x94,0x01,0x00, 0x00,0x0F,0x32,0x89, 0xC3,0xB9,0xCE,0x00, 0x00,0x00,0x0F,0x32, 0x0F,0xB6,0xCE,0x89, 0x0D,0x00,0x00,0x00, 0x00,0x0F,0xB6,0xC4, 0x89,0x05,0x00,0x00, 0x00,0x00]), identifier: "kernel", limit: 0, mask: Data([0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0x00,0x00, 0x00,0xFF]), maxKernel: "20.99.99", minKernel: "17.0.0", replace: Data([0xB9,0x64,0x00,0x01, 0xC0,0x0F,0x32,0x0F, 0xB6,0xC8,0x89,0xC6, 0xC1,0xEE,0x08,0x83, 0xE6,0x3F,0x45,0x31, 0xFF,0x31,0xD2,0x48, 0x89,0xC8,0x48,0xF7, 0xF6,0x48,0x01,0xC0, 0x66,0x90]), replaceMask: Data(), skip: 0)

let thirtiesecondRyzenPatch = kPatch(arch: "x86_64", base: "_tsc_init", comment: "algrey - tsc_init - skip msr_flex_ratio test and go grab FSBFrequency from EFI", count: 1, enabled: true, find: Data([0xF7,0xC3,0x00,0x00, 0x01,0x00,0x74]), identifier: "kernel", limit: 0, mask: Data(), maxKernel: "20.99.99", minKernel: "17.0.0", replace: Data([0x66,0x0F,0x1F,0x44, 0x00,0x00,0xEB]
), replaceMask: Data(), skip: 0)

let thirtiethirdRyzenPatch = kPatch(arch: "x86_64", base: "", comment: "algrey - lapic_init - remove version check and panic - 10.15", count: 1, enabled: true, find: Data([0x83,0xF8,0x13,0x76, 0x5E]), identifier: "kernel", limit: 0, mask: Data(), maxKernel: "19.99.99", minKernel: "19.0.0", replace: Data([0x0F,0x1F,0x44,0x00, 0x00]), replaceMask: Data(), skip: 0)

let thirtieforthRyzenPatch = kPatch(arch: "x86_64", base: "", comment: "NoOne - lapic_init - remove version check and panic - 10.16", count: 1, enabled: true, find: Data([0x83,0xF8,0x13,0x0F, 0x86,0x81,0x00,0x00, 0x00]), identifier: "kernel", limit: 0, mask: Data(), maxKernel: "20.99.99", minKernel: "20.0.0", replace: Data([0x90,0x90,0x90,0x90, 0x90,0x90,0x90,0x90, 0x90]), replaceMask: Data(), skip: 0)

let thirtiefifthRyzenPatch = kPatch(arch: "x86_64", base: "", comment: "algrey - lapic_init - remove version check and panic - 10.13/10.14", count: 1, enabled: true, find: Data([0x25,0xFC,0x00,0x00, 0x00,0x83,0xF8,0x13 ]), identifier: "kernel", limit: 0, mask: Data(), maxKernel: "18.99.99", minKernel: "17.0.0", replace: Data([0x25,0xF0,0x00,0x00, 0x00,0xEB,0x23,0x90 ]), replaceMask: Data(), skip: 0)

let thirtiesixthRyzenPatch = kPatch(arch: "x86_64", base: "", comment: "algrey - lapic_interrupt - skip checks and prevent panic - 10.15/10.16", count: 1, enabled: true, find: Data([0x83,0x3D,0x00,0x00, 0x00,0x00,0x00,0x74, 0x0E]), identifier: "kernel", limit: 0, mask: Data([0xFF,0xFF,0x00,0x00, 0x00,0xFF,0xFF,0xFF, 0xFF]), maxKernel: "20.99.99", minKernel: "19.0.0", replace: Data([0xEB,0x39,0x0F,0x1F, 0x80,0x00,0x00,0x00, 0x00]), replaceMask: Data(), skip: 0)

let thirtieseventhRyzenPatch = kPatch(arch: "x86_64", base: "_lapic_interrupt", comment: "algrey - lapic_interrupt - skip checks and prevent panic - 10.13/10.14", count: 1, enabled: true, find: Data([0x83,0x3D,0x00,0x00, 0x00,0x00,0x00,0x74, 0x0A]), identifier: "kernel", limit: 250, mask: Data([0xFF,0xFF,0x00,0x00, 0x00,0xFF,0xFF,0xFF, 0xFF]), maxKernel: "18.99.99", minKernel: "17.0.0", replace: Data([0xEB,0x48,0x0F,0x1F, 0x80,0x00,0x00,0x00, 0x00]), replaceMask: Data(), skip: 0)

let thirtieeigthRyzenPatch = kPatch(arch: "x86_64", base: "", comment: "Shaneee - mtrr_update_action - fix PAT", count: 0, enabled: true, find: Data([0x89,0xC0,0x81,0xE2, 0xFF,0xFF,0x00,0xFF, 0x81,0xCA,0x00,0x00, 0x01,0x00,0xB9,0x77, 0x02,0x00,0x00]), identifier: "kernel", limit: 0, mask: Data([0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0x0F,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF]), maxKernel: "20.99.99", minKernel: "17.0.0", replace: Data([0xB9,0x77,0x02,0x00,0x00,0xB8,0x06,0x06, 0x06,0x06,0xBA,0x06, 0x06,0x06,0x06,0x0F, 0x30,0x0F,0x09]), replaceMask: Data(), skip: 0)

